package com.huashizhaoxi.lionapp.service.Impl;

import com.huashizhaoxi.lionapp.dao.FruitMapper;
import com.huashizhaoxi.lionapp.entity.FruitItem;
import com.huashizhaoxi.lionapp.entity.FruitKind;
import com.huashizhaoxi.lionapp.service.FruitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FruitServiceImpl implements FruitService {

    @Autowired
    private FruitMapper fruitMapper;

    @Override
    public List<FruitKind> getFruitKind() {
        return fruitMapper.getFruitKind();
    }

    @Override
    public List<FruitItem> getFruitItem() {
        return fruitMapper.getFruitItem();
    }

    @Override
    public List<FruitItem> getFruitItemByKind(int fruitKindId) {
        return fruitMapper.getFruitItemByKind(fruitKindId);
    }

    @Override
    public List<FruitKind> getValidFruitKind() {
        return fruitMapper.getValidFruitKind();
    }

    @Override
    public int addFruitKind(FruitKind fruitKind) {
        return fruitMapper.addFruitKind(fruitKind);
    }

    @Override
    public int addFruitItem(FruitItem fruitItem) {
        return fruitMapper.addFruitItem(fruitItem);
    }

    @Override
    public int deleteFruitItem(int id) {
        return fruitMapper.deleteFruitItem(id);
    }

    @Override
    public void deleteFruitItemByKindId(int id) {
        fruitMapper.deleteFruitItemByKindId(id);
    }

    @Override
    public void deleteFruitKind(int id) {
        fruitMapper.deleteFruitKind(id);
    }

    @Override
    public void reviseFruitKind(FruitKind fruitKind) {
        fruitMapper.reviseFruitKind(fruitKind);
    }

    @Override
    public void reviseFruitItem(FruitItem fruitItem) {
        fruitMapper.reviseFruitItem(fruitItem);
    }
}
